Enable THD with hierarchical context parallelism - #3290
Merged
sudhakarsingh27 merged 1 commit intoAug 5, 2026
Merged
Conversation
The THD-aware A2A and P2P paths already compose correctly and match the non-CP reference in forward and backward passes. Remove the stale runtime and backend gates, and enable the existing FlashAttention and FusedAttention test coverage for this combination. Signed-off-by: Sudhakar Singh <sudhakars@nvidia.com>
cyanguwa
approved these changes
Aug 4, 2026
sudhakarsingh27
marked this pull request as ready for review
August 4, 2026 23:14
Member
Author
|
/te-ci pytorch L1 |
Contributor
Greptile SummaryThis PR enables packed THD tensors with hierarchical context parallelism by removing stale runtime, backend-selection, and test-suite exclusions.
Confidence Score: 5/5The PR appears safe to merge because the newly enabled hierarchical THD path composes existing THD-aware A2A and P2P implementations and remains protected by the relevant backend compatibility checks. The removed gates expose an implementation with dedicated THD sequence reordering, padded-sequence metadata handling, output correction, and backward gradient correction, and the distributed tests compare its forward and backward results against the non-context-parallel reference. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["THD Q/K/V and sequence metadata"] --> B["Backend selection"]
B --> C["Hierarchical CP dispatcher"]
C --> D["A2A head exchange"]
D --> E["P2P context ring"]
E --> F["FlashAttention or FusedAttention"]
F --> G["A2A output exchange"]
G --> H["THD output"]
Reviews (1): Last reviewed commit: "Enable THD with hierarchical context par..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The THD-aware A2A and P2P paths already compose correctly and match the non-CP reference in forward and backward passes. Remove the stale runtime and backend gates, and enable the existing FlashAttention and FusedAttention test coverage for this combination.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Only removes filters which are no longer necessary
Checklist: